package com.manyauthenticationway.server.manyauthenticationway.config.handle

import com.fasterxml.jackson.databind.ObjectMapper
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.security.core.AuthenticationException
import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
import org.springframework.stereotype.Component
import java.io.IOException
import javax.servlet.ServletException
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse

@Component("MyAuthenticationFailureHandler")
class MyAuthenticationFailureHandler: SimpleUrlAuthenticationFailureHandler() {
    @Autowired
    private val objectMapper: ObjectMapper? = null

    @Throws(IOException::class, ServletException::class)
    override fun onAuthenticationFailure(request: HttpServletRequest, response: HttpServletResponse, exception: AuthenticationException) {

        println("----------faiule-------")
        super.onAuthenticationFailure(request, response, exception)
    }
}